From c141d0a70a5e6190d3a473effe82a7563cd59c97 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Thu, 23 Feb 2023 09:20:03 -0600 Subject: [PATCH] filesystemmodel: fix crash when file is removed In 32247bc50e63b709ae738a95a2ec71345b5fad75 node_get_for_file() was changed to return GTK_INVALID_LIST_POSITION rather than 0 when the file is untracked. Most call sites were updated accordingly, but this one was missed. Fixes #5619 --- gtk/gtkfilesystemmodel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c index c085022e19..9f4a5fafa9 100644 --- a/gtk/gtkfilesystemmodel.c +++ b/gtk/gtkfilesystemmodel.c @@ -459,7 +459,7 @@ remove_file (GtkFileSystemModel *model, g_return_if_fail (G_IS_FILE (file)); id = node_get_for_file (model, file); - if (id == 0) + if (id == GTK_INVALID_LIST_POSITION) return; node = get_node (model, id); -- 2.30.2